<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<p:dialog xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	modal="true" width="500" height="300" resizable="false" 
	widgetVar="dialogAddFormaPagamento" id="dialogFormaPagamento" closable="false"
	appendToBody="true">

	<link type="text/css" rel="stylesheet" href="../../resources/css/style.css" />
	
	<f:facet name="header">
		<h:outputText value="Cadastrar Forma de pagamento" />
	</f:facet>
	
	<h:form id="formAddFormaPagamento" prependId="false">
		<h:panelGroup id="panelForma">
		<p:messages id="messageFormForma"/>
		
		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="Código" />
			<p:inputText style="width:100px;" disabled="true" value="#{vendaBean.newForma.id}"/>
		</h:panelGrid>
		
		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="Forma de pagamento *" />
			<p:inputText style="width:250px;" value="#{vendaBean.newForma.formaPagamento}" required="true" requiredMessage="Informe a forma de pagamento." id="inputDialogForma" maxlength="30"/>
		</h:panelGrid>

		<h:panelGrid columns="1" style="padding:5px;">
			<h:outputText value="* Campos obrigatórios" />
		</h:panelGrid>
		
		<div id="popup-buttons" style="padding-bottom: 10px;padding-right: 15px; padding-top: 10px; text-align: right;">
			<p:commandButton value="Salvar" style="height:28px;" actionListener="#{vendaBean.saveFormaFromDialog}" process="@this panelForma" update="panelForma" icon="ui-icon-disk"/>
			<p:commandButton value="Cancelar" style="height:28px;" onclick="dialogAddFormaPagamento.hide()" immediate="true" icon="ui-icon-cancel"/>
		</div>
		</h:panelGroup>
	</h:form>
</p:dialog>